<template>
    <view class="category">
        <!-- diy 分类仅展示三级分类，不显示商品列表 -->
        <three class="container"></three>
    </view>
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import Three from './three.vue'
import { useDataEffect } from './useDataEffect'
import { useAppStore } from '@/stores/app'

// 延迟初始化 store，避免在 Pinia 未完全初始化时调用
let appStore: ReturnType<typeof useAppStore> | null = null
const webType = ref<any>(null)

// 在 onMounted 中初始化 store，确保 Pinia 已完全初始化
onMounted(() => {
    appStore = useAppStore()
    if (appStore) {
        webType.value = appStore.getWebType
    }
})

// 不再根据 page.type 渲染，统一走三级分类
const { page } = useDataEffect()
</script>

<style>
.container {
    height: calc(100vh - 300rpx);
}
</style>
